export const setTabBarBadge = (
	num : number
) : void => {
	const pages : any = getCurrentPages() // 获取栈实例
	const currentRoute : string = pages[pages.length - 1].route;
	const whiteList : any = [
		'pages/home/index',
		'pages/message/index',
		'pages/news/index',
		'pages/my/index'
	]
	if (whiteList.indexOf(currentRoute) !== -1) {
		if (num === 0) {
			uni.removeTabBarBadge({
				index: 1
			})
		} else {
			uni.setTabBarBadge({
				index: 1,
				text: num > 99 ? '99+' : num.toString()
			})
		}
	}
}